
#include "find_all.h"


std::vector<size_t> find_all( std::string line, std::string match ){

  std::vector<size_t> result;
  result.clear();

  // empty line
  if ( line.empty() )
    return result;

  // empty match
  if ( match.empty() )
    return result;



  size_t found;
  found = line.find( match, 0 );

  while( found!=std::string::npos ) {

      result.push_back( found );
      found = line.find( match, found+1 );
  }


  return result;
}


